/*
 * File: ttds_core.h
 * Author: Liang YaoZhan <262666882@qq.com>
 * Brief:  timer
 *
 * Copyright (c) 2022 - 2023 Liang YaoZhan <262666882@qq.com>
 *
 * Licensed under the Academic Free License version 2.1
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 * History:
 * ================================================================
 * 2023-08-05 Liang YaoZhan <262666882@qq.com> created
 *
 */

#ifndef TTDS_CONFIG_H
#define TTDS_CONFIG_H


#ifndef TTDS_STATIC_ALLOC_COUNT 
#define TTDS_STATIC_ALLOC_COUNT 16
#endif
#ifndef TTDS_CJOB_EXTEND
#define TTDS_CJOB_EXTEND(x) void *x[2]
#endif

#define TTDS_USING_CJOBQ
#define TTDS_USING_JOB_HOOK
#define TTDS_USING_COTHREAD_POOL
#define TTDS_USING_SWITCHCASE_THREAD

/* port for HAL */
#ifdef USE_HAL_DRIVER

#ifdef STM32F429xx
#include "stm32f4xx_hal.h"
#endif

#define ttds_hw_interrupt_decl(lk) uint32_t lk
#define ttds_hw_interrupt_disable(lk) do{ if (ttds_interrupt_service_net() == 0) __disable_irq(); } while (0)
#define ttds_hw_interrupt_enable(lk) do{ if (ttds_interrupt_service_net() == 0) __enable_irq(); } while (0)
#endif

#endif
